import { Module } from '@nestjs/common';
import { DiaryChatModule } from './diaryChat/diaryChat.module';
import { DiaryModule } from './diary/diary.module';
import { CoreModule } from './core/core.module';
import { LoginModule } from './login/login.module';
import { MysqlModule } from './config/mysql';
import { UserModule } from './user/user.module';
import { VisualChatModule } from './visualChat/visualChat.module';
import { MineModule } from './mine/mine.module';
import { GoodsModule } from './goods/goods.modules';
import { PayOrderModule } from './payOrder/payOrder.modules';
import { PayNotificationModule } from './payNotify/payOrder.modules';
import JwtModule from './config/jwt';
import { VirtualCharacterModule } from './virtual-character/virtual-character.module';

const controllers = [DiaryModule, DiaryChatModule, UserModule, MineModule,
  VisualChatModule, LoginModule, CoreModule, GoodsModule, PayOrderModule,
  PayNotificationModule, VirtualCharacterModule];

// // 全局工具类
// JwtModule.register({
//   secret: 'diary_fuck', // Replace with your own secret key
//   signOptions: { expiresIn: '30d' }, // Set the expiration time as desired
// })

const tools = [JwtModule, MysqlModule]
// 注入全局JWT

@Module({
  imports: [...controllers, ...tools],
})
export class AppModule { }
